package org.melanesia.beans.validation;

import org.melanesia.beans.validation.exceptions.ValidationException;


/**
 * Interface for defining custom property validation rules.
 *
 * @author marcin.kielar
 */
public interface Validator {

    /**
     * Validates the property.
     *
     * @param bean bean to serve as a context of property validation
     * @param propertyPath path to validated property
     * @param propertyValue property value
     *
     * @throws ValidationException when validation fails
     */
    void validate(Object bean, String propertyPath, Object propertyValue) throws ValidationException;
}
